package com.fz.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fz.core.BaseEntity;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;

/**
 * <p>
 * 存储收藏的商品信息
 * </p>
 *
 * @author hyr
 * @since 2025-06-18
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Collect extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 商品名称
     */
    private String goodsName;

    /**
     * 商品图片URL
     */
    private String goodsImg;

    /**
     * 商品ID（外键）
     */
    private Long goodsId;

    /**
     * 用户ID（外键）
     */
    private Long userId;

    /**
     * 收藏时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    /**
     * 分类ID（外键）
     */
    private Long categoryId;

    /**
     * 价格（非数据库字段）
     */
    private BigDecimal price;

    /**
     * 逻辑删除（1=删除）
     */
    private Integer isDeleted;


    public Collect(String name, String imgs, Long goodsId, Long userId, LocalDateTime now, Long categoryId) {
        this.goodsName = name;
        this.goodsImg = imgs;
        this.goodsId = goodsId;
        this.userId = userId;
        this.createTime = now;
        this.categoryId = categoryId;
    }
}
